<!DOCTYPE html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Hexo, NexT" />










<meta name="description" content="Java 微信公众号网页授权写这篇文章之前简单说下，本人之前也没做过微信这方面的开发，也是属于第一次接触微信公众号开发，写下这篇博客也是为了记录自己的开发内容，也算是给微信公共号开发小白一些借鉴，不喜勿喷。好了 废话不多说  首先登录微信公众号—-点击左侧列表接口权限—-网页服务—-网页授权（网页授权获取用户基本信息）—–网页授权域名（这个域名一定是备案过的） 上面的操作完成之后 看一下微信网页授">
<meta name="keywords" content="天下事有难易乎？为之，则难者亦易矣；不为，则易者亦难矣。">
<meta property="og:type" content="article">
<meta property="og:title" content="微信公众号网页授权">
<meta property="og:url" content="http://yoursite.com/2018/06/09/Java微信公众号网页授权/index.html">
<meta property="og:site_name" content="隐">
<meta property="og:description" content="Java 微信公众号网页授权写这篇文章之前简单说下，本人之前也没做过微信这方面的开发，也是属于第一次接触微信公众号开发，写下这篇博客也是为了记录自己的开发内容，也算是给微信公共号开发小白一些借鉴，不喜勿喷。好了 废话不多说  首先登录微信公众号—-点击左侧列表接口权限—-网页服务—-网页授权（网页授权获取用户基本信息）—–网页授权域名（这个域名一定是备案过的） 上面的操作完成之后 看一下微信网页授">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://yoursite.com/uploads/3333.jpeg">
<meta property="og:updated_time" content="2018-06-09T11:14:18.700Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="微信公众号网页授权">
<meta name="twitter:description" content="Java 微信公众号网页授权写这篇文章之前简单说下，本人之前也没做过微信这方面的开发，也是属于第一次接触微信公众号开发，写下这篇博客也是为了记录自己的开发内容，也算是给微信公共号开发小白一些借鉴，不喜勿喷。好了 废话不多说  首先登录微信公众号—-点击左侧列表接口权限—-网页服务—-网页授权（网页授权获取用户基本信息）—–网页授权域名（这个域名一定是备案过的） 上面的操作完成之后 看一下微信网页授">
<meta name="twitter:image" content="http://yoursite.com/uploads/3333.jpeg">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/2018/06/09/Java微信公众号网页授权/"/>





  <title>微信公众号网页授权 | 隐</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">隐</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-question-circle"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-question-circle"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-question-circle"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-question-circle"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-question-circle"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-commonweal">
          <a href="/404.html" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-question-circle"></i> <br />
            
            公益404
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2018/06/09/Java微信公众号网页授权/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wu qiwei">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/uploads/avatar.png">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="隐">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">微信公众号网页授权</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2018-06-09T19:09:21+08:00">
                2018-06-09
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          
            <span class="post-meta-divider">|</span>
            <span class="page-pv"><i class="fa fa-file-o"></i>
            <span class="busuanzi-value" id="busuanzi_value_page_pv" ></span>
            </span>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h1 id="Java-微信公众号网页授权"><a href="#Java-微信公众号网页授权" class="headerlink" title="Java 微信公众号网页授权"></a>Java 微信公众号网页授权</h1><p>写这篇文章之前简单说下，本人之前也没做过微信这方面的开发，也是属于第一次接触微信公众号开发，写下这篇博客也是为了记录自己的开发内容，也算是给微信公共号开发小白一些借鉴，不喜勿喷。好了 废话不多说 </p>
<p>首先登录微信公众号—-点击左侧列表接口权限—-网页服务—-网页授权（网页授权获取用户基本信息）—–网页授权域名（这个域名一定是备案过的）</p>
<p>上面的操作完成之后</p>
<p>看一下微信网页授权的API 地址为<a href="https://mp.weixin.qq.com/wiki?t=resource/res_main&amp;id=mp1421140842&amp;token=&amp;lang=zh_CN" target="_blank" rel="noopener">https://mp.weixin.qq.com/wiki?t=resource/res_main&amp;id=mp1421140842&amp;token=&amp;lang=zh_CN</a><br> <img src="/uploads/3333.jpeg" alt="image"><br> 仔细看下上面图片中的参数说明</p>
<pre><code>https://open.weixin.qq.com/connect/oauth2/authorize?appid=appid&amp;redirect_uri=回调地址&amp;response_type=code&amp;scope=snsapi_userinfo&amp;state=STATE#wechat_redirect
</code></pre><p>这个回调的地址就是你的域名/项目名称/你的服务/方法</p>
<p>例如楼主的redirect_uri为http://域名/MountainTourism/wechat/getOpenid （切记这个上面一定要加http://  不能单独写域名 楼主在这吃亏了）</p>
<p>好了以上就是需要设置的地方，因为楼主的业务是需要网页授权之后返回openid,接下来直接上代码</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br></pre></td><td class="code"><pre><span class="line">* @author wuqiwei </span><br><span class="line"> * </span><br><span class="line"> */  </span><br><span class="line">@Controller  </span><br><span class="line">@ResponseBody  </span><br><span class="line">@RequestMapping(&quot;/wechat&quot;)  </span><br><span class="line">public class WeChatController &#123;  </span><br><span class="line">    @Resource  </span><br><span class="line">    private TUserService tUserService;  </span><br><span class="line">    /** </span><br><span class="line">     * 获取openid </span><br><span class="line">     * @author:wuqiwei </span><br><span class="line">     * @param @param param </span><br><span class="line">     * @param @param result </span><br><span class="line">     * @param @return </span><br><span class="line">     * @throws IOException  </span><br><span class="line">     * @throws ServletException  </span><br><span class="line">     * @date:2017年3月27日下午2:35:13 </span><br><span class="line">     */  </span><br><span class="line">    @RequestMapping(value = &quot;/getOpenid&quot;, method = RequestMethod.GET)  </span><br><span class="line">    public ModelAndView add(ModelAndView model,final HttpServletRequest request,final HttpServletResponse response) throws ServletException, IOException &#123;  </span><br><span class="line">        WxMpUser wxMpUser =  null;  </span><br><span class="line">        try &#123;  </span><br><span class="line">            System.out.println(request.getParameter(&quot;code&quot;));  </span><br><span class="line">            WxMpOAuth2AccessToken wxMpOAuth2AccessToken = WeixinHelper.getWxMpService().oauth2getAccessToken(request.getParameter(&quot;code&quot;));  </span><br><span class="line">            wxMpUser =  WeixinHelper.getWxMpService().oauth2getUserInfo(wxMpOAuth2AccessToken, null);  </span><br><span class="line">        &#125; catch (Exception e) &#123;  </span><br><span class="line">            e.printStackTrace();  </span><br><span class="line">        &#125;  </span><br><span class="line">        //先判断wxMpUser是否为null  </span><br><span class="line">//      if (wxMpUser != null) &#123;  </span><br><span class="line">////            request.getRequestDispatcher(&quot;index.jsp&quot;).forward(request,response); //请求转发  </span><br><span class="line">////            return Response.getInstance().success(&quot;1&quot;);  </span><br><span class="line">//      &#125;  </span><br><span class="line">        ModelAndView mav = new ModelAndView(&quot;index&quot;);  </span><br><span class="line">        mav.addObject(&quot;openid&quot;, wxMpUser.getOpenId());  </span><br><span class="line">        return mav;  </span><br><span class="line">    &#125;  </span><br><span class="line">&#125;  </span><br><span class="line">WeixinHelper.java</span><br><span class="line"></span><br><span class="line">package com.htht.tourism.utils;  </span><br><span class="line">  </span><br><span class="line">import java.util.HashMap;  </span><br><span class="line">import java.util.Map;  </span><br><span class="line">  </span><br><span class="line">import me.chanjar.weixin.common.bean.WxJsapiSignature;  </span><br><span class="line">import me.chanjar.weixin.common.exception.WxErrorException;  </span><br><span class="line">import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;  </span><br><span class="line">import me.chanjar.weixin.mp.api.WxMpService;  </span><br><span class="line">import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;  </span><br><span class="line">  </span><br><span class="line">/** </span><br><span class="line"> * WeixinHelper </span><br><span class="line"> */  </span><br><span class="line">public final class WeixinHelper &#123;  </span><br><span class="line">    private WeixinHelper() &#123;  </span><br><span class="line">        throw new Error(&quot;工具类不能实例化！&quot;);  </span><br><span class="line">    &#125;  </span><br><span class="line">  </span><br><span class="line">//    private static final String CONFIG_URL = &quot;application.properties&quot;;  </span><br><span class="line">    public static final String APPID = ConfigUtil.getProperty(&quot;WeChat&quot;,&quot;appid&quot;); // appid  </span><br><span class="line">    public static final String APPSECRET =  ConfigUtil.getProperty(&quot;WeChat&quot;,&quot;appsecret&quot;); // appsecret  </span><br><span class="line">    public static final String PATERNER_KEY =ConfigUtil.getProperty(&quot;WeChat&quot;,&quot;paternerKey&quot;); // 商户支付密钥  </span><br><span class="line">    public static final String MCHI_ID = ConfigUtil.getProperty(&quot;WeChat&quot;,&quot;mch_id&quot;); // 商户号  </span><br><span class="line">    public static final String NOTIFY_URL = ConfigUtil.getProperty(&quot;WeChat&quot;,&quot;notify_url&quot;);; // 回调地址  </span><br><span class="line">    public static final String TRADE_TYPE_JS = ConfigUtil.getProperty(&quot;WeChat&quot;,&quot;trade_type_js&quot;); // 交易类型  </span><br><span class="line">    public static final String WEIXIN_OAUTH2 = ConfigUtil.getProperty(&quot;WeChat&quot;,&quot;WEIXIN_OAUTH2&quot;); // 回调地址  </span><br><span class="line">    private static WxMpService wxMpService = null;  </span><br><span class="line">  </span><br><span class="line">    /** </span><br><span class="line">     * 获取WxMpService </span><br><span class="line">     */  </span><br><span class="line">    public static WxMpService getWxMpService() &#123;  </span><br><span class="line">        if (wxMpService == null) &#123;  </span><br><span class="line">            WxMpInMemoryConfigStorage config = new WxMpInMemoryConfigStorage();  </span><br><span class="line">            config.setAppId(APPID); // 设置微信公众号的appid  </span><br><span class="line">            config.setSecret(APPSECRET); // 设置微信公众号的app corpSecret  </span><br><span class="line">            // config.setToken(&quot;...&quot;); // 设置微信公众号的token  </span><br><span class="line">            // config.setAesKey(&quot;...&quot;); // 设置微信公众号的EncodingAESKey  </span><br><span class="line">            config.setOauth2redirectUri(WEIXIN_OAUTH2);  </span><br><span class="line">            wxMpService = new WxMpServiceImpl();  </span><br><span class="line">            wxMpService.setWxMpConfigStorage(config);  </span><br><span class="line">        &#125;  </span><br><span class="line">        return wxMpService;  </span><br><span class="line">    &#125;  </span><br><span class="line">  </span><br><span class="line">    /** </span><br><span class="line">     * getShortUrl </span><br><span class="line">     */  </span><br><span class="line">    public static String getShortUrl(final String url) &#123;  </span><br><span class="line">        String shortUrl = url;  </span><br><span class="line">        try &#123;  </span><br><span class="line">            shortUrl = getWxMpService().shortUrl(url);  </span><br><span class="line">        &#125; catch (WxErrorException e) &#123;  </span><br><span class="line">            e.printStackTrace();  </span><br><span class="line">        &#125;  </span><br><span class="line">        return shortUrl;  </span><br><span class="line">    &#125;  </span><br><span class="line">  </span><br><span class="line">    /** </span><br><span class="line">     * getJsapiTicket </span><br><span class="line">     */  </span><br><span class="line">    public static String getJsapiTicket() throws WxErrorException &#123;  </span><br><span class="line">        return getWxMpService().getJsapiTicket();  </span><br><span class="line">    &#125;  </span><br><span class="line">  </span><br><span class="line">    /** </span><br><span class="line">     * createJsapiSignature </span><br><span class="line">     */  </span><br><span class="line">    public static WxJsapiSignature createJsapiSignature(final String url) throws WxErrorException &#123;  </span><br><span class="line">        return getWxMpService().createJsapiSignature(url);  </span><br><span class="line">    &#125;  </span><br><span class="line">  </span><br><span class="line">    /** </span><br><span class="line">     * getJSSDKPayInfo </span><br><span class="line">     */  </span><br><span class="line">//    public Map&lt;String, String&gt; getJSSDKPayInfo(final String body, final String totalFee) throws Exception &#123;  </span><br><span class="line">//        String outTradeNum = System.currentTimeMillis() + &quot;&quot;; // 商户订单号  </span><br><span class="line">//        Map&lt;String, String&gt; paramMap = new HashMap&lt;String, String&gt;();  </span><br><span class="line">//        paramMap.put(&quot;paternerKey&quot;, PATERNER_KEY); //  </span><br><span class="line">//        paramMap.put(&quot;mch_id&quot;, MCHI_ID); //  </span><br><span class="line">//        paramMap.put(&quot;body&quot;, body); // 商品描述  </span><br><span class="line">//        paramMap.put(&quot;out_trade_no&quot;, outTradeNum); // 商户端对应订单号  </span><br><span class="line">//        paramMap.put(&quot;total_fee&quot;, totalFee + &quot;&quot;);  </span><br><span class="line">//        paramMap.put(&quot;spbill_create_ip&quot;, SystemHelper.getCurrentUserIp());  </span><br><span class="line">//        paramMap.put(&quot;notify_url&quot;, NOTIFY_URL);  </span><br><span class="line">//        paramMap.put(&quot;trade_type&quot;, TRADE_TYPE_JS);  </span><br><span class="line">//        Map&lt;String, String&gt; payInfo = WeixinHelper.getWxMpService().getJSSDKPayInfo(paramMap);  </span><br><span class="line">//        return payInfo;  </span><br><span class="line">//    &#125;  </span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>这样就可以获取到openid了 返回到前台<br>以上就是网页授权获取openid的方法 由于是第一次写这种博客 写的不是很好 请见谅</p>

      
    </div>
    
    
    

    

    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div>坚持原创技术分享，您的支持将鼓励我继续创作！</div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>打赏</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="/uploads/wechat.jpg" alt="Wu qiwei 微信支付"/>
        <p>微信支付</p>
      </div>
    

    
      <div id="alipay" style="display: inline-block">
        <img id="alipay_qr" src="/uploads/alipay.jpg" alt="Wu qiwei 支付宝"/>
        <p>支付宝</p>
      </div>
    

    

  </div>
</div>

      </div>
    

    

    <footer class="post-footer">
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2018/06/10/微信支付/" rel="prev" title="微信支付">
                微信支付 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image"
                src="/uploads/avatar.png"
                alt="Wu qiwei" />
            
              <p class="site-author-name" itemprop="name">Wu qiwei</p>
              <p class="site-description motion-element" itemprop="description">如果人生没有目标,那跟咸鱼有什么区别。</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives">
              
                  <span class="site-state-item-count">2</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            

            

          </nav>

          

          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#Java-微信公众号网页授权"><span class="nav-number">1.</span> <span class="nav-text">Java 微信公众号网页授权</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=27902937&auto=1&height=66"></iframe>
    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Wu qiwei</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Pisces</a> v5.1.4</div>




        
<div class="busuanzi-count">
  <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv">
      <i class="fa fa-user"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
      
    </span>
  

  
    <span class="site-pv">
      <i class="fa fa-eye"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
      
    </span>
  
</div>








        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

   
</body>
</html>
